package thread;

/*
 * @author zzr
 * @date: 2025/03/27  19:06
 * @description:
 */
public class ThreadDemo7 {
    public static void main(String[] args) {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    System.out.println("hello thread");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }
            }
        });

        //在 start 之前，设置进程为 后台进程
        t.setDaemon(true);

        t.start();
    }
}
